﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Windows;

namespace MT.CustomUserControl.ViewModels
{
    public class PasswordUcViewModel : ObservableObject
    {
        public Action PasswordInputChangedAction;

        private string m_Password = string.Empty;
        public string Password
        {
            get { return m_Password; }
            set
            {
                if (m_Password != value)
                {
                   SetProperty(ref m_Password, value);
                    PasswordInputChangedAction?.Invoke();
                }
            }
        }

        /// <summary>
        /// 密码检验正确标识是否显示
        /// </summary>
        private Visibility checkRightVisibility = Visibility.Hidden;
        public Visibility CheckRightVisibility
        {
            get { return checkRightVisibility; }
            set { SetProperty(ref checkRightVisibility, value); }
        }

        public delegate void EnterInPasswordEventHandler(object obj);
        public event EnterInPasswordEventHandler EnterInPasswordEvent;
        public void RaiseEnterInPasswordEvent(object obj)
        {
            EnterInPasswordEvent?.Invoke(obj);
        }
    }
}
